#!/bin/bash

# catch_atrace.sh
# GCDBenchmark
#
# Created by 郭晓龙 on 2025/10/22.
#

# 抓取
hdc shell "setenforce 0;logcat -c;rm /data/local/tmp/in_systrace.ftrace;hitrace -t 5 -b 204800 -o data/local/tmp/in_systrace.ftrace sched freq idle ffrt & sleep 1;wait;sed -i '1d' data/local/tmp/in_systrace.ftrace"

# 导出
hdc file recv /data/local/tmp/in_systrace.ftrace

# 淘宝：com.taobao.taobao4hmos
# 抖音：com.ss.hm.ugc.aweme
#pid=$(hdc shell pidof com.ss.hm.ugc.aweme)
pid=1003

python3 benchmark_playback.py --file in_systrace.ftrace --pid $((pid))
